/**
 * Copyright (c) 2016-2019 ykf All rights reserved.
 *
 * https://www.renren.io
 *
 * 版权所有，侵权必究！
 */

package com.basic.modules.sys.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.basic.common.utils.PageUtils;
import com.basic.common.utils.ParamsModel;
import com.basic.modules.sys.entity.SysRoleEntity;
import com.basic.modules.sys.entity.SysUserEntity;
import com.basic.modules.ykf.model.ExcelReq;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;


/**
 * 系统用户
 *
 * @author Mark sunlightcs@gmail.com
 */
public interface SysUserService extends IService<SysUserEntity> {

	PageUtils queryPage(ParamsModel<SysUserEntity> params);

    boolean isMasterCompany();

    List<String> getPowerCompanyNos();

	List<Long> getPowerCustomerIds(List<Long> powerSubAccountIds);

	List<Long> getOneselfShopIds();

	boolean getOneselfFlag(Long userId);

	boolean getOneselfFlag();

	/**
	 * 查询用户的所有权限
	 * @param userId  用户ID
	 */
	List<String> queryAllPerms(Long userId);

	/**
	 * 查询用户的所有菜单ID
	 */
	List<Long> queryAllMenuId(Long userId);

	/**
	 * 根据用户名，查询系统用户
	 */
	SysUserEntity queryByUserName(String username);

	/**
	 * 保存用户
	 */
	void saveUser(SysUserEntity user);

	/**
	 * 修改用户
	 */
	void update(SysUserEntity user);

	/**
	 * 删除用户
	 */
	void deleteBatch(Long[] userIds);

	/**
	 * 修改密码
	 * @param userId       用户ID
	 * @param newPassword  新密码
	 */
	boolean updatePassword(Long userId, String newPassword, String salt);

	PageUtils queryCusSerPage(ParamsModel<SysUserEntity> params);

    void dispatchRole(SysUserEntity user);

	List<SysRoleEntity> searchDispatchRole(SysUserEntity user);

    void employeeManagement(ExcelReq req, HttpServletResponse response) throws IOException;

	List<Long> getPowerUserIds();

	List<Long> getPowerSubAccountIds();

	List<Long> getOneselfPowerSubAccountIds();

	List<Long> getPowerCustomerShopIds();

	List<Long> getOneselfPowerCustomerShopIds();

	List<Long> getPowerCustomerShopIds(List<Long> powerSubAccountIds);

	List<Long> getPowerCustomerIds();

	List<Long> getPowerUIds();

    void customerServiceList(ExcelReq req, HttpServletResponse response) throws IOException;

	List<SysUserEntity> getKueFuList(String companyName,String postName);
}
